From: Siegfried-Angel Gevatter Pujals Date: Tue, 11 Aug 2009 23:30:58 +0000 (+0200) Subject: Catch exception trying to create a preview of an unknown image type X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~11099 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b51bcf3e2b8c90d34a2fcf7726b11156c2241377;p=gnome-shell.git Catch exception trying to create a preview of an unknown image type --- diff --git a/js/ui/docDisplay.js b/js/ui/docDisplay.js index a1cc71ccb..d2d4fa305 100644 --- a/js/ui/docDisplay.js +++ b/js/ui/docDisplay.js @@ -72,8 +72,15 @@ DocDisplayItem.prototype = { if (this._docInfo.mimeType == null || this._docInfo.mimeType.indexOf("image/") != 0) return null; - return Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.NONE, - this._docInfo.uri, availableWidth, availableHeight); + try { + return Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.NONE, + this._docInfo.uri, availableWidth, availableHeight); + } catch (e) { + // An exception will be raised when the image format isn't know + /* FIXME: http://bugzilla.gnome.org/show_bug.cgi?id=591480: should + * only ignore GDK_PIXBUF_ERROR_UNKNOWN_TYPE. */ + return null; + } }, //// Private Methods ////